<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@page isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>租房订单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script src="../statics/js/rem.js"></script>
    <script src="../statics/js/jquery.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../statics/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="../statics/css/page.css"/>
    <link rel="stylesheet" type="text/css" href="../statics/css/all.css"/>
    <link rel="stylesheet" type="text/css" href="../statics/css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../statics/css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="../statics/css/loading.css"/>
    <link rel="stylesheet" type="text/css" href="../statics/slick/slick.css"/>


    <script type="text/javascript" src="../statics/js/jquery-1.8.3.min.js"></script>
    <script src="../statics/layui/layui.all.js"></script>
    <script type="text/javascript">
        $(window).load(function () {
            $(".loading").addClass("loader-chanage")
            $(".loading").fadeOut(300)
        })
        $(function () {
            $("#qxOrders").click(function(){
               if(confirm("是否确认取消订单？")){
                   $.ajax({
                       type: "post",
                       url: "../orders/qxOrders.json",
                       data: {"orders_id": $("#orders_id").val()},
                       success: function (result) {
                           if (result.defult == "true") {
                               var layer = layui.layer
                                   , form = layui.form;
                               layer.msg('删除成功');
                               setTimeout(function(){
                                   location.href="../orders/y-order.html";
                               },1000)
                           }else{
                               var layer = layui.layer
                                   , form = layui.form;
                               layer.msg('删除失败');
                               return;
                           }
                       }
                   })
               }
            })
        })
    </script>
</head>
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<%
    Object name = session.getAttribute("user");
    if (name == null) {
        out.print("<script>alert('请登录');location='../jsp/sign.jsp'</script>");
    }
%>
<body>
<div class="headertwo clearfloat" id="header">
    <a href="../user/p-center.html?liindex=3" class="fl box-s"><i class="iconfont icon-arrow-l fl"></i></a>
    <p class="fl">租房订单</p>
</div>

<div class="rent clearfloat" id="main">
    <div class="top clearfloat">
        <ul id="click">
            <li >
                <a href="../orders/rent-order.html" id="toQ">全部订单</a>
            </li>
            <li>
                <a href="../orders/w-order.html" id="toW">待付款</a>
            </li>
            <li  class="cur">
                <a href="../orders/y-order.html" id="toY">已完成</a>
            </li>
        </ul>
    </div>

    <c:if test="${yOrders.size()==0}">
        <div class="empty-list clearfloat" id="main">
            <i class="iconfont icon-meineirong"></i>
            <p>还没有内容哦！</p>
        </div>
    </c:if>

    <c:forEach items="${yOrders}" var="orders">
        <div class="schedule clearfloat collection" id="wOrders">
            <div class="content clearfloat box-s">
                <div class="topsche-top box-s clearfloat">
                    <p class="fl add">
                        下单时间：<fmt:formatDate value="${orders.dtime}" pattern="yyyy-MM-dd"></fmt:formatDate>
                    </p>
                    <p class="tit fr">
                        <c:if test="${orders.zfzt eq 1}">
                            已付款
                        </c:if>
                    </p>
                </div>
                <div class="list clearfloat fl box-s">
                    <a href="../houses/houseDetails/${orders.house.house_id}">
                        <div class="tu clearfloat" >
                            <img src="../statics/upload/${orders.ordersimage}" style="height: 3rem"/>
                        </div>
                        <div class="right clearfloat">
                            <div class="tit clearfloat">
                                <p class="fl">${orders.house.title}</p>
                            </div>
                            <p class="recom-jianjie">${orders.htype.shi}室${orders.htype.ting}厅 | ${orders.house.area}m² | ${orders.ftype.ftypeName}</p>
                            <p class="recom-jianjie" style="color: crimson;font-weight: bold">居住日期：<span style="color: #7c8291;"><fmt:formatDate value="${orders.firstday}" pattern="yyyy-MM-dd"></fmt:formatDate> 至 <fmt:formatDate value="${orders.lastday}" pattern="yyyy-MM-dd"></fmt:formatDate></span></p>
                            <div class="recom-bottom clearfloat">
                                总金额：${orders.price}元
                            </div>
                        </div>
                    </a>
                </div>
                <input type="hidden" value="${orders.house.house_id}">
                <div class="topsche-top entrust box-s clearfloat">
                        ${orders.users.users_id}
                    <a href="../com/assess.html/${orders.house.house_id}" class="tit fr entrust-btn ">
                        待评价
                    </a>
                </div>
            </div>
        </div>
    </c:forEach>
</div>
</body>
<script type="text/javascript" src="../statics/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../statics/js/jquery.SuperSlide.2.1.js"></script>
<script type="text/javascript" src="../statics/slick/slick.min.js"></script>
<script type="text/javascript" src="../statics/js/jquery.leanModal.min.js"></script>
<script type="text/javascript" src="../statics/js/tchuang.js"></script>
<script type="text/javascript" src="../statics/js/hmt.js"></script>
</html>
